package com.example.mydesignmodule.memo;

/**
 * @author tgw
 * @date 2021/3/3
 * @describe 备忘录模式
 */
class MemoRunMain {

    public static void main(String[] args) {
        GameAction gameAction = new GameAction();
        gameAction.playGame();

        //备忘录 记录
        MemoAction memoAction = new MemoAction();
        memoAction.setGameParamMemo(gameAction.createGameMemo());
        gameAction.quiteGame();

        System.out.println("未加载进度 直接开始玩：");
        gameAction.playGame();

        System.out.println("加载进度玩：");
        gameAction.loadGameMemo(memoAction.getGameParam());
        gameAction.playGame();
        gameAction.playGame();
        gameAction.playGame();
        gameAction.quiteGame();
        gameAction.playGame();
        gameAction.playGame();
    }
}
